export default {
    "type": "page",
    "title": "列表页面",
    "body": [
        {
            "type": "crud",
            "syncLocation": false,
            "api": {
                "method": "get",
                "url": "app/datas/crud"
            },
            "columns": [
                {
                    "name": "id",
                    "label": "ID",
                    "type": "text",
                },
                {
                    "name": "field1",
                    "label": "字段1",
                    "type": "text",
                },
                {
                    "type": "date",
                    "label": "字段2",
                    "name": "field2",
                },
                {
                    "type": "text",
                    "label": "字段3",
                    "name": "field3",
                },
                {
                    "type": "operation",
                    "label": "操作",
                    "buttons": [
                        {
                            "label": "编辑",
                            "type": "button",
                            "actionType": "dialog",
                            "level": "link",
                            "dialog": {
                                "title": "编辑",
                                "body": {
                                    "type": "form",
                                    "api": "app/datas/update",
                                    "body": [
                                        {
                                            "name": "id",
                                            "label": "ID",
                                            "type": "input-text"
                                        },
                                        {
                                            "name": "field1",
                                            "label": "字段1",
                                            "type": "input-text"
                                        },
                                        {
                                            "label": "字段2",
                                            "name": "field2",
                                            "type": "input-date"
                                        },
                                        {
                                            "label": "字段3",
                                            "name": "field3",
                                            "type": "input-text"
                                        }
                                    ]
                                }
                            },
                        },
                        {
                            "label": "查看",
                            "type": "button",
                            "actionType": "dialog",
                            "level": "link",
                            "dialog": {
                                "title": "查看详情",
                                "body": {
                                    "type": "form",
                                    "api": "app/datas/update",
                                    "body": [
                                        {
                                            "name": "id",
                                            "label": "ID",
                                            "type": "static"
                                        },
                                        {
                                            "name": "field1",
                                            "label": "字段1",
                                            "type": "static"
                                        },
                                        {
                                            "label": "字段2",
                                            "name": "field2",
                                            "type": "static"
                                        },
                                        {
                                            "label": "字段3",
                                            "name": "field3",
                                            "type": "static"
                                        }
                                    ]
                                }
                            },
                        },
                        {
                            "type": "button",
                            "label": "删除",
                            "actionType": "ajax",
                            "level": "link",
                            "className": "text-danger",
                            "confirmText": "确定要删除？",
                            "api": {
                                "method": "post",
                                "url": "app/datas/delete"
                            },
                        }
                    ],
                }
            ],
            "bulkActions": [
                {
                    "type": "button",
                    "level": "danger",
                    "label": "批量删除",
                    "actionType": "ajax",
                    "confirmText": "确定要删除？",
                    "api": "app/datas/batch-delete",
                },
                {
                    "type": "button",
                    "label": "批量编辑",
                    "actionType": "dialog",
                    "dialog": {
                        "type": "dialog",
                        "title": "批量编辑",
                        "size": "md",
                        "body": [
                            {
                                "type": "form",
                                "api": "app/datas/batch-edit",
                                "body": [
                                    {
                                        "label": "字段1",
                                        "text": "字段1",
                                        "type": "input-text",
                                        "name": "field1"
                                    }
                                ]
                            }
                        ]
                    },
                }
            ],
            "itemActions": [],
            "features": [
                "create",
                "filter",
                "bulkDelete",
                "bulkUpdate",
                "update",
                "view",
                "delete"
            ],
            "filterColumnCount": 3,
            "headerToolbar": [
                {
                    "label": "新增",
                    "type": "button",
                    "actionType": "dialog",
                    "level": "primary",
                    "dialog": {
                        "title": "新增",
                        "body": {
                            "type": "form",
                            "api": {
                                "method": "post",
                                "url": "app/datas/crud"
                            },
                            "body": [
                                {
                                    "type": "input-text",
                                    "name": "id",
                                    "label": "ID"
                                },
                                {
                                    "type": "input-text",
                                    "name": "field1",
                                    "label": "字段1"
                                },
                                {
                                    "type": "input-date",
                                    "name": "field2",
                                    "label": "字段2"
                                },
                                {
                                    "type": "input-text",
                                    "name": "field3",
                                    "label": "字段3"
                                }
                            ]
                        }
                    },
                },
                "bulkActions"
            ],
            "perPageAvailable": [
                10
            ],
            "messages": {},
            "filter": {
                "title": "查询条件",
                "body": [
                    {
                        "type": "input-text",
                        "name": "keywords",
                        "label": "关键字",
                    }
                ],
            }
        }
    ],
}